package cn.kawa.feign;


import cn.kawa.domain.MovieTicket;
import cn.kawa.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "service-movie",fallbackFactory = MovieFeignClientFallBack.class)
@RequestMapping("/movieTicket")
public interface MovieFeignClient {
    @RequestMapping(value = "/list",method = RequestMethod.GET)
    JsonResult list();
    @RequestMapping(value = "/{id}",method = RequestMethod.GET)
    JsonResult get(@PathVariable("id")Long id);
    @RequestMapping(value = "/buy/{userId}/{movieId}",method = RequestMethod.GET)
    JsonResult buy(@PathVariable("userId")Long userId, @PathVariable("movieId")Long movieId);
    @RequestMapping(value = "/give/{userId}",method = RequestMethod.GET)
    JsonResult give(@PathVariable("userId")Long userId);
    @RequestMapping(value = "/watch/{userId}/{movieId}",method = RequestMethod.GET)
    JsonResult watch(@PathVariable("userId")Long userId, @PathVariable("movieId")Long movieId);
}
